<template>
  <Layout>
    <van-nav-bar
      title="vite-webapp-template"
      left-text="返回"
      left-arrow
      @click-left="toHome"
    />
    <div class="mouse">Mouse position: X={{ x }}, Y={{ y }}</div>
  </Layout>
</template>

<script setup lang="ts">
import { useMousePosition } from "@/hooks/useMousePosition";
import { useRouter } from "vue-router";
const router = useRouter();
const toHome = () => {
  router.push("/");
};

const { x, y } = useMousePosition();
</script>

<style scoped lang="scss">
.mouse {
  margin-top: 20px;
  text-align: center;
  font-size: 14px;
  color: #666;
}
</style>
